package com.nick.factory.simple;

import com.nick.factory.Apple;
import com.nick.factory.Banana;
import com.nick.factory.Fruit;

/**
 * Created by xiaobao on 2017/7/13.
 */
public class FruitFactory {

    public Fruit createFruit(String name) {
        Fruit fruit = null;
        if ("Apple".equals(name)) {
            return new Apple();
        } else if ("Banana".equals(name)) {
            return new Banana();
        } else {
            return null;
        }
    }
}
